Repository navigation
fix(mcpx): match semantic feedback to exact tool identities - #13624
Merged
Merged
Conversation
The feedback store matched tools with a substring LIKE over the comma-joined tools_used list, while writers and readers spelled the same tool differently: the direct-call path records "server:tool", semantic ranking asks for "namespace.tool" (the view Function), and proxy capture stored the client's offered tool names as if they had been invoked. Feedback for one tool therefore leaked into longer names it is a prefix of, colon-spelled history never matched the dot-spelled query, and merely-offered tools collected execution evidence. - logstore canonicalises tool identities on write to the stable namespace.tool form (the historical colon spelling maps onto it), and matches whole list elements exactly at query time across both spellings, so legacy rows keep answering. - ToolFeedbackAdjustment and FindCorrelatedQueries accept alias identities; semantic ranking passes the server identity behind the view's function name, so call-path feedback and view-path ranking share one history. - Interactions gain a tools_offered list (column added in place for existing stores). Proxy capture records offered tools there: execution adjustments count invoked tools only, retrieval adjustments and correlated queries count invoked + offered. - New disposable-store tests cover exact matching (score A once; A_suffix and unrelated tools unchanged), the historical colon form, a namespace alias, offered-vs-invoked separation, and legacy rows preserved. Refs #13573.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #13573: semantic feedback now matches exact tool identities across the call and proxy paths.
The defect. The feedback store matched tools with
tools_used LIKE '%<tool>%'over the comma-joined list, while the writers and readers spelled the same tool differently: the direct-call path recordsserver:tool, semantic ranking asks fornamespace.tool(the view'sFunction), and proxy capture stored the client's offered tool names as if they had been invoked. Feedback leaked into longer names the tool is a prefix of, colon-spelled history never literally matched the dot-spelled query, and merely-offered tools collected execution evidence.The change.
logstorecanonicalises tool identities on write to the stablenamespace.toolform (the historical colon spelling maps onto it; new records are uniform), and matches whole list elements exactly at query time across both spellings — legacy rows keep answering and are never rewritten.ToolFeedbackAdjustment/FindCorrelatedQueriesaccept alias identities. Semantic ranking (daemon/registry.go) passes the server identity behind the view's function name, so call-path feedback and view-path ranking share one history.tools_offeredlist (column added in place for existing stores; their rows read back as "nothing offered"). Proxy capture records offered tools there. Execution adjustments count invoked tools only; retrieval adjustments and correlated queries count invoked + offered, since retrieval feedback judges the offered set.Tests (new
feedback_identity_test.go, disposable stores):A_suffixand unrelated tools stay neutral, and A's average is not diluted byA_suffixrows.Verification (laptop runs in the lane worktree):
go build ./...clean,go vetclean, gofmt clean;go test ./internal/logstore/ok,go test ./internal/daemon/ok (179s),go test ./internal/cli/ok.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.